<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
>
<head>
    <meta charset="utf-8">
    <title>基本资料</title>
    <meta content="webkit" name="renderer">
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
    <link href="/URMS/lib/layui-v2.5.5/css/layui.css" media="all" rel="stylesheet">
    <link href="/URMS/css/public.css" media="all" rel="stylesheet">
    <style>
        .layui-form-item .layui-input-company {
            width: auto;
            padding-right: 10px;
            line-height: 38px;
        }
    </style>
</head>
<body>
<div class="layuimini-container" style="text-align: center;width: 800px">
    <div class="layuimini-main">

        <input name="id" th:value="${session.loginUser.id}" type="hidden">
        <input name="id" th:value="${session.loginUser.status}" type="hidden">
        <div class="layui-form layuimini-form">
            <div class="layui-form-item">
                <label class="layui-form-label required">账号</label>
                <div class="layui-input-block">
                    <input class="layui-input" lay-reqtext="账号不能为空" lay-verify="required" name="account"
                           placeholder="请输入账号" th:value="${session.loginUser.account}" type="text">
                    <tip>填写自己管理账号的名称。</tip>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">用户名</label>
                <div class="layui-input-block">
                    <input class="layui-input" lay-reqtext="用户名不能为空" lay-verify="required" name="name"
                           placeholder="请输入用户名" th:value="${session.loginUser.name}" type="text">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn layui-btn-normal" lay-filter="saveBtn" lay-submit>确认保存</button>
                </div>
            </div>
        </div>
    </div>
</div>
<script charset="utf-8" src="/URMS/layui-v2.5.5/layui.js"></script>
<script charset="utf-8" src="/URMS/js/lay-config.js?v=1.0.4"></script>
<script>
    layui.use(['form', 'miniTab'], function () {
        var form = layui.form,
            layer = layui.layer,
            miniTab = layui.miniTab;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            var index = layer.confirm(JSON.stringify(data.field), {
                title: '最终的提交信息'

            }, function () {
                $.ajax({
                    url: "/URMS/sysUser/editSubmit",
                    data: {sysUser: data},
                    type: "POST",
                    dataType: "json",
                    success: function (data) {
                        if (data == false) {
                            layer.msg("修改失败");
                            return false
                        } else {
                            layer.msg("修改成功")
                        }
                    },
                    error: function (XMLHttpResponse) {
                        layer.msg("登录出错");
                    }
                });

                // 关闭弹出层
                layer.close(index);

                var iframeIndex = parent.layer.getFrameIndex(window.name);
                parent.layer.close(iframeIndex);

            });

            return false;
        });

    });
</script>
</body>
</html>